/*
 * Copyright (c) 2022-2022 All rights Reserved.
 */

package com.driving.core.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.driving.core.base.IBaseMapper;
import com.driving.core.entity.Exercise;

/**
 * 习题操作
 *
 * @author SAGITTAR
 * @since 2017
 */
@Mapper
public interface IExerciseMapper extends IBaseMapper<Exercise> {

    /**
     * 查询指定科目的试题章节
     *
     * @param subjectId subjectId
     * @param type type
     * @return 查询指定科目的试题章节
     */
    List<Integer> selectChapterBySubjectIdAndType(@Param("subjectId") int subjectId, @Param("type") String type);

    /**
     * 查询错误题集或收藏题集
     *
     * @param studentId studentId
     * @param subjectId subjectId
     * @param from from
     * @return 查询错误题集或收藏题集
     */
    List<Map<String, Object>> selectIncorrectOrCollectedList(@Param(value = "studentId") int studentId,
            @Param(value = "subjectId") int subjectId, @Param(value = "from") int from);
}
